import 'package:p_location/map/res/user_trace_area_info.dart';
import 'package:p_location/map/res/user_path_detail.dart';

class UserPathInfo {
  List<UserPathGroupDTO> userPathGroupDTOList;
  List<UserTraceAreaInfo> areas;

  UserPathInfo({this.userPathGroupDTOList, this.areas});

  factory UserPathInfo.fromJson(Map<String, dynamic> json) {
    return UserPathInfo(
      userPathGroupDTOList: json['userPathGroupDTOList'] != null
          ? (json['userPathGroupDTOList'] as List)
              .map((i) => UserPathGroupDTO.fromJson(i))
              .toList()
          : null,
      areas: json['areas'] != null
          ? (json['areas'] as List).map((i) => UserTraceAreaInfo.fromJson(i)).toList()
          : null,
    );
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    if (this.userPathGroupDTOList != null) {
      data['userPathGroupDTOList'] =
          this.userPathGroupDTOList.map((v) => v.toJson()).toList();
    }
    return data;
  }
}
